﻿
Partial Class WebForm_Main_SearchFindDirtyHeader
    Inherits System.Web.UI.UserControl

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not IsPostBack Then
            RaiseEvent Loaded(Me, New EventArgs)
        End If
    End Sub

    Protected Sub gvFindDirtyHeaderInfo_PageIndexChanging(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewPageEventArgs) Handles gvFindDirtyHeaderInfo.PageIndexChanging
        Me.gvFindDirtyHeaderInfo.PageIndex = e.NewPageIndex
        Me.BindGV()
    End Sub
End Class

Partial Class WebForm_Main_SearchFindDirtyHeader
    Public Sub BindGV()
        Dim sql As New MyStringBuilder
        Dim dat As New clsData

        sql.AppendFormat("select a.*,b.RegionName+c.RegionName+a.Location as Address from FindDirtyHeader a")
        sql.AppendFormat(" Join Region b on Left(a.VillageID,3)=b.RegionID")
        sql.AppendFormat(" and b.RegionType='T'")
        sql.AppendFormat(" Join Region c on a.VillageID=c.RegionID ")
        sql.AppendFormat(" and c.RegionType='V' ")
        sql.AppendFormat(" where a.Status <> '{0}' ", "Y")
        sql.AppendFormat(" order by CreateDate desc")

        Me.gvFindDirtyHeaderInfo.DataSource = dat.GetData(sql)
        Me.gvFindDirtyHeaderInfo.DataBind()
    End Sub

    Public Event Loaded(ByVal source As Object, ByVal e As EventArgs)
End Class